package com.immer.session.request;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestEventSubject {

    private RequestEventObserver requestEventObserver;

    public RequestEventSubject() {
    }

    public void register(RequestEventObserver requestEventObserver){
        this.requestEventObserver = requestEventObserver;
    }
    /**
     * 请求执行成功后的操作
     *
     * @param request
     * @param response
     */
    public void completedRequest(HttpServletRequest request, HttpServletResponse response) {
        if (requestEventObserver != null) {
            requestEventObserver.completedRequest(request, response);
        }
    }
}
